﻿{% extends "gma/base.html" %}
{% load mytag %}

<!-- CONTENT
  =====================================================================-->

{% block content %}

<div class="page__bd">
    <div class="weui-panel weui-panel_access">
        <div class="weui-panel__hd"> 投诉列表({{ total_count }}) </div>
        <div class="weui-panel__bd">
            {% for log in logs %}
            <a href="{% url 'gma:complaint_detail' log.cid %}" class="weui-media-box weui-media-box_appmsg weui-cell_access">
                <div class="weui-media-box__hd">
                    <img class="weui-media-box__thumb avatar" src="{{ log.reporter_avatar|cdn }}" alt="">
                </div>

                <i class="fa fa-bomb"></i>
                &nbsp; &nbsp;

                <div class="weui-media-box__hd">
                    <img class="weui-media-box__thumb avatar" src="{{ log.avatar|cdn }}" alt="">
                </div>
                <div class="weui-media-box__bd">
                    <h4 class="weui-media-box__title">{{ log.nickname }}</h4>
                    <p class="weui-media-box__desc">{{ log.title }}</p>
                    <p class="weui-media-box__desc">{{ log.create_time|date:"Y-m-d" }}</p>
                </div>

                <div class="weui-cell__ft">
                    #{{ log.uid }}
                </div>
            </a>
            {% endfor %}

            <div class="weui-media-box weui-media-box_text">
                <ul class="weui-media-box__info">
                    <li class="weui-media-box__info__meta"> 共有 {{ total_count }} 条投诉记录 </li>
                </ul>
            </div>
        </div>
    </div>
</div>

<div class="page__ft">
    <a href="{% url 'gma:home' %}">
        <span class="bottom-logo">
           HiBao
       </span>
    </a>
</div>

{% endblock content %}


<!-- SCRIPT
  =====================================================================-->

{% block extra_js %}

<script type="text/javascript">
$(function() {
    var $searchBar = $('#searchBar'),
        $searchResult = $('#searchResult'),
        $searchText = $('#searchText'),
        $searchInput = $('#searchInput'),
        $searchClear = $('#searchClear'),
        $searchCancel = $('#searchCancel');

    function hideSearchResult(){
        $searchResult.hide();
        $searchInput.val('');
    }
    function cancelSearch(){
        hideSearchResult();
        $searchBar.removeClass('weui-search-bar_focusing');
        $searchText.show();
    }

    $searchText.on('click', function(){
        $searchBar.addClass('weui-search-bar_focusing');
        $searchInput.focus();
    });
    $searchInput
        .on('blur', function () {
            if(!this.value.length) cancelSearch();
        })
        .on('input', function(){
            if(this.value.length) {
                $searchResult.show();
            } else {
                $searchResult.hide();
            }
        })
    ;
    $searchClear.on('click', function(){
        hideSearchResult();
        $searchInput.focus();
    });
    $searchCancel.on('click', function(){
        cancelSearch();
        $searchInput.blur();
    });

    hideSearchResult();
});
</script>

{% endblock extra_js %}